/***************************************************************************
 *   Copyright (C) 2009 by maarten,,,   *
 *   maarten@maarten-laptop   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef SCENESCENEMANAGER_H
#define SCENESCENEMANAGER_H

#include <QString>
#include <QVector>

namespace object{
class ObjectList;
};

namespace scene {

class SceneElement;
class Camera;
class Scene;
class SubScene;
/**
	@author maarten,,, <maarten@maarten-laptop>
*/
class SceneManager{

public:
    SceneManager();
    ~SceneManager();

    void loadScene(QString file);
    
    bool loadObject(QString name);

    void addSceneElement(SceneElement *sel);
    void addCamera(SceneElement *sel);
    void addLight(SceneElement *sel);
    void addScene(SceneElement *sel);
    void addGeometry(SceneElement *sel);
    void addMaterial(SceneElement *sel);
    void addTexture(SceneElement *sel);
    void addSubScene(SubScene *sel);
    
    void clear();

    Camera* getCamera(QString camName);
    SceneElement* getLight(QString lightName);
    Scene* getScene();
    SceneElement* getGeometry(QString name);
    SceneElement* getMaterial(QString name);
    SceneElement* getTexture(QString name);
    
    void printAllElements();
    
    object::ObjectList * getObjectList(){return m_objectList;}
    
    void setStatus(int status){m_status = status;}
    int getStatus(){return m_status;}
    
    void addSurfaceLight(QString tempName);
    bool isSurfaceLight(QString tempName);

private:
    QVector<SceneElement*> m_sceneElements; // elements not classified below

    QVector<SceneElement*> m_cameras; // collection of cams
    QVector<SceneElement*> m_scenes;  // collection of scenes
    QVector<SceneElement*> m_lights;  // collection of lights
    QVector<SceneElement*> m_geometries;  // collection of geometries
    QVector<SceneElement*> m_materials;  // collection of materials
    QVector<SceneElement*> m_textures;  // collection of materials
    

    QVector<QString> m_surfaceLights;
    
    object::ObjectList *m_objectList;

    int m_playScene;
    
    int m_status;
    
};

} // end namespace scene

#endif
